package com.authentication.code;

import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationToken;

public class ClientAndUserAuthenticationPair {

    private final Authentication userAuthentication;
    private final OAuth2AuthorizationCodeRequestAuthenticationToken clientAuthenticationToken;

    private final String[] grantedScopes;

    public ClientAndUserAuthenticationPair(Authentication userAuthentication, OAuth2AuthorizationCodeRequestAuthenticationToken clientAuthenticationToken, String[] grantedScopes) {
        this.userAuthentication=userAuthentication;
        this.clientAuthenticationToken=clientAuthenticationToken;
        this.grantedScopes=grantedScopes;
    }

    public Authentication getUserAuthentication() {
        return userAuthentication;
    }

    public OAuth2AuthorizationCodeRequestAuthenticationToken getClientAuthenticationToken() {
        return clientAuthenticationToken;
    }

    public String[] getGrantedScopes() {
        return grantedScopes;
    }
}
